package com.example.raspberryPi_demo.entity;

import java.io.Serializable;

/**
 * @author 
 * 
 */
public class Equipment implements Serializable {
    private String macAddress;

    private String raspberryPiName;

    private Integer updateInterval;

    private static final long serialVersionUID = 1L;


    public String getMacAddress() {
        return macAddress;
    }
    //一般mac地址是不变的先留下
    public void setMacAddress(String macAddress) {
        this.macAddress = macAddress;
    }

    public String getRaspberryPiName() {
        return raspberryPiName;
    }

    public void setRaspberryPiName(String raspberryPiName) {
        this.raspberryPiName = raspberryPiName;
    }

    public Integer getUpdateInterval() {
        return updateInterval;
    }

    public void setUpdateInterval(int updateInterval) {
        this.updateInterval = updateInterval;
    }
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Equipment other = (Equipment) that;
        return (this.getMacAddress() == null ? other.getMacAddress() == null : this.getMacAddress().equals(other.getMacAddress()))
            && (this.getRaspberryPiName() == null ? other.getRaspberryPiName() == null : this.getRaspberryPiName().equals(other.getRaspberryPiName()))
            && (this.getUpdateInterval() == null ? other.getUpdateInterval() == null : this.getUpdateInterval().equals(other.getUpdateInterval()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMacAddress() == null) ? 0 : getMacAddress().hashCode());
        result = prime * result + ((getRaspberryPiName() == null) ? 0 : getRaspberryPiName().hashCode());
        result = prime * result + ((getUpdateInterval() == null) ? 0 : getUpdateInterval().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", macaddress=").append(macAddress);
        sb.append(", raspberrypiname=").append(raspberryPiName);
        sb.append(", updateinterval=").append(updateInterval);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}